<?php
namespace app\crm\controller;
use think\Loader;
use think\Cache;


class Delivermanager extends CrmController
{   
    /**
     * 发货列表界面
     * @return [type] [description]
     */
    public function deliverList()
    {	
		//分配增删改的权限
		$menuname = "Deliver List";
		$p_menuname = $_SESSION['menu'][$menuname]; //父菜单
		$priv = $_SESSION["user_priv"][$p_menuname][$menuname];	
		$this->assign("username",$_SESSION['user_info']['username']);
        $this->assign("priv",$priv);
	
		$Logistics = Loader::model('Ordermanager')->getLogisticsMode();
        $this->assign("Logistics",$Logistics);
		// 模板输出
        return $this->fetch('deliverList');
    }
	
	public function deliverDataList()
    {
		// 模板输出
        $arrData = Loader::model('Delivermanager')->orderData();
        echo json_encode($arrData);
    }
	
	/**
     * 匹配物流单号
     * @return [type] [description]
     */
	public function matchingNumber()
	{
		Loader::model('Delivermanager')->matchingNumber();
		
	}
	
	/**
     * 匹配顺丰小白单
     * @return [type] [description]
     */
	public function matchingSFNumber()
	{
		Loader::model('Delivermanager')->matchingSFNumber();
		
	}
	
	/**
	 * 查询顺丰物流单号
	 */
	public function searchSfOrder(){
		$result = Loader::model('Delivermanager')->searchSfOrder();
		if ($result !== false){
			echo json_encode(array('success'=>true,'data'=>$result));
		} else {
			echo json_encode(array('msg'=>'查询失败！'));
		}
	}

    















}